FROM golang:1.19 AS builder

COPY . /src
WORKDIR /src

RUN GOPROXY=https://goproxy.cn make build

# FROM debian:stable-slim

# RUN apt-get update && apt-get install -y --no-install-recommends \
# 		ca-certificates  \
#         netbase \
#         && rm -rf /var/lib/apt/lists/ \
#         && apt-get autoremove -y && apt-get autoclean -y

# COPY --from=builder /src/bin /app

# WORKDIR /app

# EXPOSE 8000
# EXPOSE 9000
# VOLUME /data/conf

# CMD ["./server", "-conf", "/data/conf"]

FROM centos:7.9.2009
LABEL test
RUN echo "export LANG=en_US.utf8" >> /etc/profile
RUN echo "export LC_ALL=en_US.utf8" >> /etc/profile
RUN echo "export TZ=Asia/Shanghai" >> /etc/profile
RUN source /etc/profile
RUN rm -rf /etc/localtime
RUN ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

RUN yum clean all
RUN yum makecache
RUN yum -y install openssl openssh-server openssh-clients install net-tools at crond which yum-cron zlib-devel bzip2-devel openssl-devel ncurses-devel epel-release gcc gcc-c++ xz-devel readline-devel gdbm-devel sqlite-devel tk-devel db4-devel libpcap-devel libffi-devel vim rsync telnet lrzsz unzip bc rsyslog bash
RUN echo dango@test | passwd --stdin root
RUN sed -i 's/#UseDNS yes/UseDNS no/g' /etc/ssh/sshd_config
RUN rsyslogd

EXPOSE 80
